package com.lc202309;

/**
 * Description:
 *
 * @Create 2023/9/22 23:02
 * @Version 1.0
 */
public class Solution69 {
    public int mySqrt(int x) {
        if (x == 0) {
            return 0;
        }
        int res = (int) Math.exp(0.5 * Math.log(x));
        return (long) (res + 1) * (res + 1) > x ? res : res + 1;
    }
}
